﻿using System.Linq;

namespace Anmlz.Data.UnitOfWork
{
    using Anmlz.Model.Entities;
    using Anmlz.Services;

    public  partial  class UnitOfWork
    {
       public CreatureTemperament GetCreatureTemperamentByName(string name)
       {
           switch (languageService.GetCurrentLanguage())
           {
               case CultureNames.English:
                   return CreatureTemperaments.All.FirstOrDefault(ct => ct.NameEn == name);
               case CultureNames.Russian:
                   return CreatureTemperaments.All.FirstOrDefault(ct => ct.NameRu == name);
           }
           return null;
       }
    }
}
